package cn.org.eshow.webapp.action.response;


import cn.org.eshow.model.ProductOrder;

import java.util.Date;
import java.util.List;

/**
 * 商品订单返回对象
 */
public class ProductOrderResponse {

    public Integer id;//商品订单ID
    public Date addTime = new Date();// 添加时间
    public Date updateTime = new Date();// 更新时间
    public String category;// 分类（用户订单）
    public String no;// 订单号
    public Double price;//总计价格（不含优惠券）
    public Double pay ;// 支付人民币价格(用户实际付款金额)
    public Double origPrice;//总计原价
    public Double discountPrice;//优惠金额
    public Double couponPrice;//红包金额
    public Integer payment;// 付款方式（0支付宝,1微信）
    public String statements;// 状态说明

    public Integer state;//订单状态（ -1已取消  0付款状态  , 1配送状态 , 2完成状态（评价）  3 退款状态   ）
    public Integer payState;//付款状态  (0待支付   1已支付)
    public Integer deliveryState;//配送状态 0待接单   1待配送/待收货，2已收货
    public Integer commentState;//评价状态（0未评价，1已评价）
    public Integer refundState;// 退款状态  0无退款，1已退款，2退款中（回调用）

    public Double refundAmount;//退款金额
    public String reason;//原因
    public String remark;//备注
    public String address;//收货地址
    public String addrName;//收货人姓名
    public String addrMobile;//收货人手机号码
    public String callback;//支付回调
    public Double enabled;//是否可用
    public String province;//省份
    public String city;//城市
    public String district;//区县
    public UserSimpleResponse user;// 用户
    public UserCouponResponse userCoupon;// 用户优惠券
    public List<OrderItemResponse> orderItems;//子标签数组

    public ProductOrderResponse() {

    }

    public ProductOrderResponse(ProductOrder productOrder) {
        this.id = productOrder.getId();
        this.addTime = productOrder.getAddTime();
        this.updateTime = productOrder.getUpdateTime();
        this.no = productOrder.getNo();
        this.origPrice = productOrder.getOrigPrice();
        this.price = productOrder.getPrice();
        this.pay = productOrder.getPay();
        this.state = productOrder.getState();
        this.payState=productOrder.getPayState();
        this.deliveryState=productOrder.getDeliveryState();
        this.statements = productOrder.getStatements();
        this.refundState = productOrder.getRefundState();
        this.refundAmount = productOrder.getRefundAmount();
        this.remark = productOrder.getRemark();
        this.address = productOrder.getAddress();
        this.addrName = productOrder.getAddrName();
        this.addrMobile = productOrder.getAddrMobile();
        this.discountPrice = productOrder.getDiscount();
        this.couponPrice = productOrder.getCoupon();
        this.commentState = productOrder.getCommentState();
        this.reason = productOrder.getReason();
        this.province = productOrder.getProvince();
        this.city = productOrder.getCity();
        this.district = productOrder.getDistrict();
        if (productOrder.getUser() != null) {
            this.user = new UserSimpleResponse(productOrder.getUser());
        }
        if (productOrder.getUserCoupon() != null) {
            this.userCoupon = new UserCouponResponse(productOrder.getUserCoupon());
        }

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public Double getPay() {
        return pay;
    }

    public void setPay(Double pay) {
        this.pay = pay;
    }

    public Double getOrigPrice() {
        return origPrice;
    }

    public void setOrigPrice(Double origPrice) {
        this.origPrice = origPrice;
    }

    public Double getDiscountPrice() {
        return discountPrice;
    }

    public void setDiscountPrice(Double discountPrice) {
        this.discountPrice = discountPrice;
    }

    public Double getCouponPrice() {
        return couponPrice;
    }

    public void setCouponPrice(Double couponPrice) {
        this.couponPrice = couponPrice;
    }

    public Integer getPayment() {
        return payment;
    }

    public void setPayment(Integer payment) {
        this.payment = payment;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getStatements() {
        return statements;
    }

    public void setStatements(String statements) {
        this.statements = statements;
    }

    public Integer getCommentState() {
        return commentState;
    }

    public void setCommentState(Integer commentState) {
        this.commentState = commentState;
    }

    public Integer getRefundState() {
        return refundState;
    }

    public void setRefundState(Integer refundState) {
        this.refundState = refundState;
    }

    public Double getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(Double refundAmount) {
        this.refundAmount = refundAmount;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAddrName() {
        return addrName;
    }

    public void setAddrName(String addrName) {
        this.addrName = addrName;
    }

    public String getAddrMobile() {
        return addrMobile;
    }

    public void setAddrMobile(String addrMobile) {
        this.addrMobile = addrMobile;
    }

    public String getCallback() {
        return callback;
    }

    public void setCallback(String callback) {
        this.callback = callback;
    }

    public Double getEnabled() {
        return enabled;
    }

    public void setEnabled(Double enabled) {
        this.enabled = enabled;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public UserSimpleResponse getUser() {
        return user;
    }

    public void setUser(UserSimpleResponse user) {
        this.user = user;
    }

    public UserCouponResponse getUserCoupon() {
        return userCoupon;
    }

    public void setUserCoupon(UserCouponResponse userCoupon) {
        this.userCoupon = userCoupon;
    }

    public List<OrderItemResponse> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItemResponse> orderItems) {
        this.orderItems = orderItems;
    }

    public Integer getDeliveryState() {
        return deliveryState;
    }

    public void setDeliveryState(Integer deliveryState) {
        this.deliveryState = deliveryState;
    }

    public Integer getPayState() {
        return payState;
    }

    public void setPayState(Integer payState) {
        this.payState = payState;
    }
}
